import { request } from '@/utils/request'



export default ({

    getToken() {
        let data = {
            appKey: "ding8n0tcqjvc0veclgs",
            appSecret: "dpTt0m4HOtwDcjlkfTgXLTn36HEJfxND0zPaeKYWULxKnfDHkmPLKnOgf28pJkZV"
        }
        return request("/cmeduGateway/cmeduweb00001/v1/getToken", "post", data)

    },

    async getEmpList() {
        let info = await this.getToken();
        return request("/cmeduGateway/cmeduweb00001/v1/getEmpInfo?access_token=" + info.data.accessToken, "post")
    },

    async getUserInfoByEmpId(data) {
        let info = await this.getToken();
        return request("/cmeduGateway/cmeduweb00001/v1/getUsreInfoByEmpId?access_token=" + info.data.accessToken, "post", data)
    },

    async getUserDetail(data) {
        let info = await this.getToken();
        return request("/cmeduGateway/cmeduweb00001/v1/getUserDetail?access_token=" + info.data.accessToken, "post", data)
    },

    async createMeeting(data) {
        let info = await this.getToken();
        return request("/cmeduGateway/cmeduweb00001/v1/createMeeting?x-acs-dingtalk-access-token=" + info.data.accessToken, "post", data)
    },



    async addMeeting(data) {
        return request("/cmeduApi/dingding/v1/dingding_em_230509001/updateOrInsert", "post", data)
    },
    async getMeeting(data) {
        let info = await this.getToken();
        return request("/cmeduGateway/cmeduweb00001/v1/getMeetingInfo/" + data + "?x-acs-dingtalk-access-token=" + info.data.accessToken, "get")
    },

    async getMeetingId() {
        return request("/cmeduApi/dingding/v1/dingding_em_230509001/lists", "get")
    },
    async getvedioMeetingData(data) {
        let info = await this.getToken();
        return request("/cmeduGateway/dingding/v1/getDingMeetingCount?statDate=" + data + "&x-acs-dingtalk-access-token=" + info.data.accessToken, "get")
    },

    async createUser(data) {
        let info = await this.getToken();
        return request("/cmeduGateway/dingding/v1/create?access_token=" + info.data.accessToken, "post", data)
    },

    async getUserData(data) {
        let info = await this.getToken();
        return request("/cmeduGateway/dingding/v1/getUserData?access_token=" + info.data.accessToken, "post", data)
    },
    //创建部门
    async createDepartment(data) {
        let info = await this.getToken();
        return request("/cmeduGateway/dingding/v1/createDepartment?access_token=" + info.data.accessToken, "post", data)
    },

    //获取会议参会人数list
    async getMeetingMemberInfo(data) {
        let info = await this.getToken();
        return request('/cmeduGateway/dingding/v1/' + data + '/getMeetingMemberInfo?x-acs-dingtalk-access-token=' + info.data.accessToken, "get");
    },
})